// 用户模块pinia
import { defineStore } from "pinia";
import { ref } from "vue";

export const UseuserInfo = defineStore('user', () => {
    // 操作token
    const token = ref('')
    const getToken = (val) => {
        token.value = val
    }
    // 操作用户信息
    const userInfo = ref({})
    const getUserInfo = (val) => {
        userInfo.value = val
    }
    return {
        token,
        getToken,
        userInfo,
        getUserInfo
    }
}, {
    persist: true, //开启持续化储存
},)
